package com.fesine.blog.controller;

import com.fesine.blog.vo.Menu;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import java.util.ArrayList;
import java.util.List;

/**
 * @description: 管理员主页控制器
 * @author: Fesine
 * @createTime:2017/12/17
 * @update:修改内容
 * @author: Fesine
 * @updateTime:2017/12/17
 */
@Controller
@RequestMapping("/admins")
public class AdminController {


    private static final Logger logger = LoggerFactory.getLogger(AdminController.class);

    @GetMapping
    public ModelAndView listUsers(Model model){
        List<Menu> list = new ArrayList<>();
        list.add(new Menu("用户管理", "/users"));
        list.add(new Menu("角色管理", "/roles"));
        list.add(new Menu("博客管理", "/blogs"));
        list.add(new Menu("评论管理", "/commits"));
        model.addAttribute("list", list);
        return new ModelAndView("/admins/index", "model", model);
    }


}
